package com.redis.bloom.filter.controller;

import com.redis.bloom.filter.data.vo.req.OrderSearchReqVO;
import com.redis.bloom.filter.data.vo.resp.OrderRespVO;
import com.redis.bloom.filter.data.vo.resp.OrderSearchRespVO;
import com.redis.bloom.filter.process.TbOrderProcess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author chen
 * @Description 订单controller
 * @Date 2022/6/2 9:37
 **/
@RestController
public class TbOrderController {
    @Autowired
    TbOrderProcess tbOrderProcess;

    /**
     * @author chen
     * @description 下单
     * @param paramMap 前端入参
     * @date: 2024/2/5 8:15
     * @return com.redis.bloom.filter.model.RepVO
     */
    @PostMapping("/order")
    public OrderRespVO order(@RequestBody Map<String,Object> paramMap) {
        //订单下单
        tbOrderProcess.order();
        return new OrderRespVO("0");
    }

    /**
     * @author chen
     * @description 提供下游查询订单接口
     * @param reqVO 前端入参
     * @date: 2024/2/5 8:15
     * @return com.redis.bloom.filter.model.RepVO
     */
    @PostMapping("/orderSearch")
    public OrderSearchRespVO orderSearch(@RequestBody OrderSearchReqVO reqVO) {
        //订单查询
        return tbOrderProcess.orderSearch(reqVO);
    }
}
